package com.lanou.zy.projecta.greedao.entity;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.lanou.zy.projecta.greedao.entity.SlideResult;
import com.lanou.zy.projecta.greedao.entity.User;
import com.lanou.zy.projecta.greedao.entity.SubjectResult;
import com.lanou.zy.projecta.greedao.entity.HotNotes;

import com.lanou.zy.projecta.greedao.entity.SlideResultDao;
import com.lanou.zy.projecta.greedao.entity.UserDao;
import com.lanou.zy.projecta.greedao.entity.SubjectResultDao;
import com.lanou.zy.projecta.greedao.entity.HotNotesDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig slideResultDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig subjectResultDaoConfig;
    private final DaoConfig hotNotesDaoConfig;

    private final SlideResultDao slideResultDao;
    private final UserDao userDao;
    private final SubjectResultDao subjectResultDao;
    private final HotNotesDao hotNotesDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        slideResultDaoConfig = daoConfigMap.get(SlideResultDao.class).clone();
        slideResultDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        subjectResultDaoConfig = daoConfigMap.get(SubjectResultDao.class).clone();
        subjectResultDaoConfig.initIdentityScope(type);

        hotNotesDaoConfig = daoConfigMap.get(HotNotesDao.class).clone();
        hotNotesDaoConfig.initIdentityScope(type);

        slideResultDao = new SlideResultDao(slideResultDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        subjectResultDao = new SubjectResultDao(subjectResultDaoConfig, this);
        hotNotesDao = new HotNotesDao(hotNotesDaoConfig, this);

        registerDao(SlideResult.class, slideResultDao);
        registerDao(User.class, userDao);
        registerDao(SubjectResult.class, subjectResultDao);
        registerDao(HotNotes.class, hotNotesDao);
    }
    
    public void clear() {
        slideResultDaoConfig.getIdentityScope().clear();
        userDaoConfig.getIdentityScope().clear();
        subjectResultDaoConfig.getIdentityScope().clear();
        hotNotesDaoConfig.getIdentityScope().clear();
    }

    public SlideResultDao getSlideResultDao() {
        return slideResultDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public SubjectResultDao getSubjectResultDao() {
        return subjectResultDao;
    }

    public HotNotesDao getHotNotesDao() {
        return hotNotesDao;
    }

}
